<?php

namespace App\Http\Controllers\Admin\Links;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Http\Model\Link;
class LinkController extends Controller
{
    //标签列表
    public function linkList()
    {
        $list = Link::select()->paginate(5);
        $links_name = request('search');
        if (!empty($links_name)){
            $list = Link::where('links_name', 'like', "%{$links_name}%")->paginate(5);
        }
        return view('Admin/Links/link_list')->with('list',$list);
    }

    // 删除标签
    public function linkDel($id)
    {
        return $res = Link::where(['id'=>$id])->delete();
    }


}
